//
//  OrderDropView.m
//  小团购
//
//  Created by 樊荣海 on 15/1/23.
//  Copyright (c) 2015年 樊荣海. All rights reserved.
//

#import "OrderDropView.h"

@implementation OrderDropView

- (instancetype)initWithFrame:(CGRect)frame {
    
    if (self == [super initWithFrame:frame]) {
        
        // 1.当前城市的所有区域
        NSArray *orders = [MetaDataTool sharedMetaDataTool].totalOrders;

        //1.2.所有排序
        for (int i = 0; i < orders.count; i++) {

            OrderDropBtn *btn = [[OrderDropBtn alloc] initWithFrame:CGRectMake(DropScrollViewW*i, 0, 0, 0)];
            btn.model = orders[i];
            
            [btn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
            [self.scrollView addSubview:btn];
            
        }
        
        self.scrollView.contentSize = CGSizeMake(DropScrollViewW*orders.count, DropScrollViewH);
    }
    
    return self;
    
}


@end
